#ifndef _ASKAL_DATA_CACHE_H_
#define _ASKAL_DATA_CACHE_H_

#include "AskalExport.h"
#include "AprilMesh.h"
#include "Skeleton.h"
#include "hltypes/hmap.h"
#include "hltypes/hstring.h"


namespace askal
{
	
	enum Options
	{
		OPT_NONE = 0,
		OPT_HIGHEST_WEIGHT_NORMAL = 1,
		OPT_PRECALCULATE_MATRICES = 2, // 2do
		OPT_USE_VERTEX_KEYFRAME_ANIMATION = 3, // 2do
		OPT_USE_VERTEX_SHADER_SKINNING = 4, // 2do
		OPT_USE_4X3_MATRICES = 5 // 2do
	};

	class AskalExport AskalDataCache
	{

		static AskalDataCache* ms_instance;
		
		hmap<hstr, Skeleton*> _mSkeletonCache;
		hmap<hstr, AprilMesh*> _mMeshCache;
		//hmap<hstr, VertexKeyframeTrack> _mVetexKeyframeTrack;
		
		

	public:
		static AskalDataCache* Instance();
		static void Release();
		
		void loadMeshAndSkeletonData(chstr meshname);
		Skeleton* getSkeleton(chstr name);
		//void buildVertexKeyframes(chstr skeletonName, chstr meshName);
		AprilMesh* getMesh(chstr name);

	private:
		AskalDataCache();
		~AskalDataCache();

	};

}

#endif // _ASKAL_DATA_CACHE_H_
